package com.kaigejava.iterator.iterator;

import com.kaigejava.iterator.MenuItem;

import java.util.ArrayList;

/**
 * Created by kaigejava on 2019/9/7.
 *
 */
public class CakeHouseMenuIterator{
    private ArrayList<MenuItem> menuItems;
    public CakeHouseMenuIterator() {
        menuItems = new ArrayList<MenuItem>();

        addItem("KFC Cake Breakfast","boiled eggs&toast&cabbage",true,3.99f);
        addItem("MDL Cake Breakfast","fried eggs&toast",false,3.59f);
        addItem("Stawberry Cake","fresh stawberry",true,3.29f);
        addItem("Regular Cake Breakfast","toast&sausage",true,2.59f);
    }

    private void addItem(String name, String description, boolean vegetable,
                         float price) {
        MenuItem menuItem = new MenuItem(name, description, vegetable, price);
        menuItems.add(menuItem);
    }

    public Iterator getIterator()
    {
        return new CakeHouseIterator( menuItems) ;
    }


}
